package com.vrv.netmgr.alarm.detail;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageButton;
import android.widget.TextView;

import com.vrv.netmgr.R;
import com.vrv.netmgr.vo.SerializableCloseIOpenONet;

/**
 * @Description 断开内网上外网策略详细信息
 * @author yangzijian
 * @date
 * 
 */
public class DetailCloseIOpenONetActivity extends Activity {
	//
	private SerializableCloseIOpenONet info;
	public void onCreate(Bundle savedInstanceState){
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
		setContentView(R.layout.detail_closeiopenonet);
		getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.common_title);
		getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
		//
		initViews();
		setTitle();
	}
	//
	public void initViews(){
		//
		TextView unit = (TextView) findViewById(R.id.openiionet_unit);
		TextView dep = (TextView) findViewById(R.id.openiionet_dep);
		TextView user = (TextView) findViewById(R.id.openiionet_user);
		TextView tel = (TextView) findViewById(R.id.openiionet_tel);
		TextView ip = (TextView) findViewById(R.id.openiionet_ip);
		TextView iip = (TextView) findViewById(R.id.openiionet_iip);
		TextView start = (TextView) findViewById(R.id.openiionet_start);
		TextView end = (TextView) findViewById(R.id.openiionet_end);
		TextView time = (TextView) findViewById(R.id.openiionet_time);
		TextView type = (TextView) findViewById(R.id.openiionet_type);
		TextView login = (TextView) findViewById(R.id.openiionet_login);
		TextView alarm = (TextView) findViewById(R.id.openiionet_alarm);
		TextView check = (TextView) findViewById(R.id.openiionet_check);
		//
		info = (SerializableCloseIOpenONet) getIntent().getSerializableExtra("info");
		//
		unit.setText(info.getUNIT_NAME());
		dep.setText(info.getDEP_NAME());
		user.setText(info.getUSER_NAME());
		tel.setText(info.getTEL());
		ip.setText(info.getIP_ADDRESS());
		iip.setText(info.getVIOLATION_IP());
		start.setText(info.getNET_START_TIME());
		end.setText(info.getNET_END_TIME());
		time.setText(info.getNET_DURATION());
		type.setText(info.getALARM_TYPE());
		login.setText(info.getLOGIN_USER());
		alarm.setText(info.getALARM_TIME());
		check.setText(info.getLOOK_FLAG());
	}
	public void setTitle() {
		TextView title = (TextView) findViewById(R.id.title_text);
		title.setText("断开内网上外网"+"["+info.IP_ADDRESS+"]");

		/**
		 * 返回按钮
		 */
		ImageButton backBtn = (ImageButton) findViewById(R.id.backBtn);
		backBtn.setVisibility(View.VISIBLE);
		backBtn.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				onBackPressed();
			}
		});
	}
	@Override
	public void onBackPressed() {
		finish();
		overridePendingTransition(R.anim.push_right_out, R.anim.push_right_in);
		super.onBackPressed();
	}
}
